package org.wzq.learn;/*
 * author      : 吴中勤 
 * date        : 2019/1/25
 * description : TODO
 */

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class LoggingAspect {

    @Before("@annotation(Log))")
    public void logBefore(JoinPoint joinPoint) {
        System.out.println("logBefore ");
    }

//    @Before("execution(public void org.wzq.learn.Dormi.sayHi(..))")
//    public void logBefore(JoinPoint joinPoint) {
//        System.out.println("logBefore ");
//    }
//
//    // first rule for method annotation, second - for class
//    @Pointcut("execution(public void org.wzq.learn.Dormi.sayHi(..))")
//    public void execute() {
//    }
//
//    @Before("execute()")
//    public void executeBefore() {
//        System.out.println("logBefore ");
//    }
}
